﻿package net.pezzato.genetree.graphics{
	import net.pezzato.genetree.graphics.NodeWidget;
	import net.pezzato.graphics.Widget;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import net.pezzato.genetree.info.GeneNode;
	public class TestNodeWidget extends MovieClip{
		public function TestNodeWidget() {
			loadTree();
		}
		private function onLoadTreeComplete(event:Event):void {
			var xml:XML = new XML(event.target.data);
			var node:GeneNode = new GeneNode(xml);
			var container:Widget = new Widget(null);
			addChild(container);
			var nw:NodeWidget = new NodeWidget(container, node); 
			nw.setNodeTitle("name");
			container.x = -50;
			container.y = 200;
		}
		private function loadTree(event:Event = null):void {
			var loader:URLLoader = new URLLoader();
			var request:URLRequest = new URLRequest("id-00000001.xml");
			loader.addEventListener(Event.COMPLETE, onLoadTreeComplete);
			loader.load(request);
		}
	}
}